﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace PMSMVC.Models
{
    [Table("DocTask")]
    public class DocTask
    {
        [Key,DatabaseGenerated(DatabaseGeneratedOption.Identity),Display(Name="项目")]
        public int TaskID { get; set; }
        [Display(Name = "项目编号"), StringLength(50), ForeignKey("Project")]
        public string ProjectID { get; set; }
        [Display(Name = "任务名称"), StringLength(50)]
        public string TaskName { get; set; }
        [Display(Name = "录入时间") ,DataType(DataType.Date)]
        public DateTime RecordTime { get; set; }
        [Display(Name = "发布人"), StringLength(20)]
        public string Publisher { get; set; }
        [Display(Name = "开始时间"), DataType(DataType.Date)]
        public DateTime BeginTime { get; set; }
        [Display(Name = "要求完成时间"), DataType(DataType.Date)]
        public DateTime PostTime { get; set; }
        [Display(Name = "实施人"), StringLength(20)]
        public string Executor { get; set; }
        [Display(Name = "审核人"), StringLength(20)]
        public string Checker { get; set; }
        [Display(Name = "任务详细"), StringLength(200), DataType(DataType.MultilineText)]
        public string TaskDetail { get; set; }
        [Display(Name = "任务状态"), StringLength(10)]
        public string TaskStatus { get; set; }
        public virtual Project Project { get; set; }
        public virtual List<DocTaskChange> DocTaskChanges { get; set; }
        public virtual DocTaskCheck DocTaskCheck { get; set; }
    }

    public class DocTaskEditModel
    {
        public DocTask DocTask { get; set; }
        [Display(Name = "修改时间"), DataType(DataType.Date)]
        public DateTime RecordTime { get; set; }
        [Display(Name = "修改人"), StringLength(20)]
        public string UserID { get; set; }
        [Display(Name = "修改原因与内容"), StringLength(200), DataType(DataType.MultilineText)]
        public string ChangeDetail { get; set; }
    }

    public class DocTaskStatisticbyExecutorModel
    {
        [Display(Name="实施人")]
        public string Executor { get; set; }
        [Display(Name="完成率")]
        public double Quantity { get; set; }
        [Display(Name="完成数")]
        public int Element { get; set; }
        [Display(Name="任务数")]
        public int Total { get; set; }
    }

    public class DocTaskStatisticbyExecutorDTModel
    {
        public DateTime StartTime { get; set; }
        public DateTime StopTime { get; set; }
        public List<DocTaskStatisticbyExecutorModel> DocTaskStatisticbyExecutorModels { get; set; }
    }
}